//
//  TKIMFileUpload.h
//  TKIM
//
//  Created by liupm on 15/11/11.
//  Copyright © 2015年 liupm. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TKIMFileUpDownProtocol.h"

typedef NS_ENUM(NSInteger,TKIMFileUploadModelType) {
    TKIMFileUploadModelTypeString,//文字
    TKIMFileUploadModelTypeFile//文件
};

@interface TKIMFileUploadModel : NSObject
@property(nonatomic,copy) NSString *key;
@property(nonatomic,strong) NSObject *value;
@property(nonatomic,copy) NSString *fileName;
@property(nonatomic,copy) NSString *contentType;//image/jpeg ......
@property(nonatomic,assign) TKIMFileUploadModelType type;
@end

//@interface TKIMFileUpload : TKIMConnection<TKIMFileUpDownProtocol>
@interface TKIMFileUpload : NSObject<TKIMFileUpDownProtocol>
@property(nonatomic,strong) FileUpDownloadUploadFail failCallback;//上传下载失败
@property(nonatomic,strong) FileUpDownloadUploading loadingCallback;//正在上传下载
@property(nonatomic,strong) FileUplDownLoadSuccess successCallback;//上传下载成功
@property(nonatomic,strong) NSMutableData *receiveData;//服务器返回的数据

/**
 *  @Author lpm, 15-10-23 13:10:03
 *
 *  @brief  文件上传
 *
 *  @param url       上传地址
 *  @param data      上传文件数据
 *  @param paramData 上传参数
 *  @param mimeType  文件类型
 *  @param fileName  文件名
 */
- (void)uploadFileWithURL:(NSURL *)url fileData:(NSData *)filedata extParams:(NSArray<TKIMFileUploadModel *> *)extParams fileName:(NSString *)fileName  mimeType:(TKIMFileUploadMimeType)mimeType complete:(FileUplDownLoadSuccess )complete process:(FileUpDownloadUploading) process fail:(FileUpDownloadUploadFail)fail;;

@end
